package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 图片
 * </p>
 *
 * @author yinjc123
 * @since 2018-04-12
 */
@TableName("crm_pic")
@Getter
@Setter
@ToString
@ApiModel
public class Pic extends Model<Pic> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    @ApiModelProperty(value = "标题",required = true)
    private String title;
    /**
     * 图片
     */
    @NotBlank(message = "图片不能为空")
    @ApiModelProperty(value = "图片url",required = true)
    private String pic;
    /**
     * 分类
     */
    @TableField("type_code")
    @NotBlank(message = "分类不能为空")
    @ApiModelProperty(value = "话术分类code,从字典中获取，对应字典的num",required = true)
    private String typeCode;
    /**
     * 时间
     */
    @TableField("create_date")
    private Date createDate;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
